<?php
require_once('PHPUnit/Framework.php');
require_once('TVB/pms/pdes/common/bootstrap.php');
require_once('TVB/pms/pdes/common/util/portal/PortalData.class.php');

class PortalDataGetOperationTest extends PHPUnit_Framework_TestCase
{
    public function setUp()
    {
    }

    public function tearDown()
    {
    }

    public function testProgramme()
    {
        $dataArray = array(
            'programme' => array(
                array('id' => 2),
            )
        );
        $ret = PortalData::getOperationByData($dataArray);
        //var_dump($ret);
    }

    public function testEpisode()
    {
        $dataArray = array(
            'episode' => array(
                array('id' => 16),
            )
        );
        $ret = PortalData::getOperationByData($dataArray);
        //var_dump($ret);
    }

    public function testCast()
    {
        $dataArray = array(
            'cast' => array(
                array('id' => 1),
            )
        );
        $ret = PortalData::getOperationByData($dataArray);
        //var_dump($ret);
    }

    public function testVideo()
    {
        $dataArray = array(
            'video' => array(
                array('id' => 101924),
            )
        );
        $ret = PortalData::getOperationByData($dataArray);
        //var_dump($ret);
    }

    public function testChapter()
    {
        $dataArray = array(
            'chapter' => array(
                array('id' => 13628),
            )
        );
        $ret = PortalData::getOperationByData($dataArray);
        //var_dump($ret);
    }

    public function testInfo()
    {
        $dataArray = array(
            'info_address' => array(
                array('id' => 2),
            ),
            'info_award' => array(
                array('id' => 2),
            ),
            'info_biography' => array(
                array('id' => 2),
            ),
            'info_general_information' => array(
                array('id' => 2),
            ),
            'info_product' => array(
                array('id' => 2),
            ),
            'info_q_a' => array(
                array('id' => 2),
            ),
            'info_recipe' => array(
                array('id' => 2),
            ),
            'info_song' => array(
                array('id' => 3),
            ),
            'info_pageant' => array(
                array('id' => 2),
            ),
        );
        $ret = PortalData::getOperationByData($dataArray);
        //var_dump($ret);
    }

    public function testImage()
    {
        $dataArray = array(
            'image' => array(
                array('id' => 103312),
            )
        );
        $ret = PortalData::getOperationByData($dataArray);
        //var_dump($ret);
    }

    public function testFolder()
    {
        $dataArray = array(
            'folder' => array(
                array('id' => 1),
            )
        );
        $ret = PortalData::getOperationByData($dataArray);
        //var_dump($ret);
    }

    public function testFolderVideo()
    {
        $dataArray = array(
            'folder' => array(
                array('id' => 264, 'folder_item_type_id' => 1),
                array('id' => 393, 'folder_item_type_id' => 2),
            ),
            'folder_item' => array(
                array('folder_id' => 264, 'item_id' =>102440),
                array('folder_id' => 393, 'item_id' =>103456),
            )
        );
        $ret = PortalData::getOperationByData($dataArray);
        var_dump($ret);
    }


}
?>
